package com.file.system.service.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.file.system.entity.system.WebDictionary;
import com.file.system.entity.res.DataPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 字典 服务类
 *
 * @author jch
 * @since 2022-07-27
 */
public interface IWebDictionaryService {

    //添加字典
    boolean save(WebDictionary webDictionary);

    //删除字典
    boolean removeById(@Param("id") Long id);

    //编辑字典
    boolean updateById(@Param("et") WebDictionary webDictionary);

    //编辑
    boolean update(@Param("ew") UpdateWrapper<WebDictionary> query);

    //添加字典(批量)
    boolean saveBatch(@Param("list") List<WebDictionary> webDictionaryList);

    //查询字典
    List<WebDictionary> list(@Param("ew") QueryWrapper<WebDictionary> query);

    //通过ids查询字典集合
    List<WebDictionary> listByIds(List<Long> ids);

    //查询所有非删除状态字典
    List<WebDictionary> listAll();

    //查询字典分页
    DataPage<List<WebDictionary>> page(@Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize, @Param("ew") QueryWrapper<WebDictionary> query);

    //通过id查询字典
    WebDictionary getById(@Param("id") Long id);

    //通过条件查询字典
    WebDictionary getOne(@Param("ew") QueryWrapper<WebDictionary> query);

    //查询字典数量
    int count(@Param("ew") QueryWrapper<WebDictionary> query);


}
